com.cete.dynamicpdf
Class IccProfile



Example: The following example shows how to use IccProfile class.

import com.cete.dynamicpdf.*;
import com.cete.dynamicpdf.pageelements.Label;
import com.cete.dynamicpdf.text.TrueTypeFont;
 
public class MyClass{
        public static void main(String args[]) {
        // Create a document and set it's properties
        Document document = new Document();
        document.setTitle( "PDF/X-1a Document" );
        document.setPdfVersion( PdfVersion.v1_4 );
        
        // Create a page to add to the document
        Page page = new Page( PageSize.LETTER, PageOrientation.PORTRAIT, 54.0f );
        
        document.setPdfXVersion( PdfXVersion.PDF_X_1a_2003);
        IccProfile iccProfile = new IccProfile( "[PhysicalPath]/fileName.icc" );
        OutputIntent outputIntent = new OutputIntent( "CGATS TR 001-1995 (SWOP)", "CGATS TR 001", "http://www.color.org", "U.S. Web Coated (SWOP) v2", iccProfile );
        document.getOutputIntents().add( outputIntent );
        document.setTrapped( Trapped.FALSE );
        
        // Create a Label using a TrueType font and CMYK color
        String text = "PDF/X 1-a Document";
        OpenTypeFont font = new OpenTypeFont( "[PhysicalPath]/verdana.ttf" );
        Label label = new Label( text, 0, 0, 504, 100, font, 18, TextAlign.CENTER, CmykColor.getBlueViolet() );
        
        // Add label to page
        page.getElements().add( label );
        
        // Add page to document
        document.getPages().add( page );
        
        // Save the PDF document
        document.draw("[PhysicalPath]/MyDocument.pdf");
    }
 }